
package bean;

import dao.ClienteFacade;
import dao.VentaFacade;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import model.Cliente;
import model.Venta;


@ManagedBean
@SessionScoped
public class VentaBean implements Serializable{
    @EJB
    private ClienteFacade clienteFacade;
    @EJB
    private VentaFacade ventaFacade;
    
    private Cliente cliente;
    
    
    
    private Venta selected;
    

    
    public VentaBean() {
    }

    public Venta getSelected() {
        if(selected == null){
            selected = new Venta();
        }
        return selected;
    }

    public void setSelected(Venta selected) {
        this.selected = selected;
    }
    
    public  List<Venta> listado(){
        return ventaFacade.findAll();
    }
    
    

    public Cliente getCliente() {
        return cliente;
    }
    
    
}
